import sys
import common

if len(sys.argv)<2:
     print("usage:")
     exit(0)

if len(sys.argv)==3:
	dir=sys.argv[2]
else:
	dir=''

myfile = open(dir+'\\'+sys.argv[1], "w")

s='__'+sys.argv[1].replace('.','_').replace('-','_')+'__'

n=sys.argv[1][:-2]
if n.startswith('dex-'):
	n=n[4:]
c=common.get_cls_name(n.replace('-','_'))

s1="""
#ifndef {0}
#define {0}

class {1}
""".format(s,c)


s1=s1+'''
{
	char dummy;
public:
	int Size();
	void print();
	int sprint(char * buffer);
};
'''


s1=s1+"""#endif//{0}""".format(s)

#print(s1)

myfile.write(s1)

myfile.close()